<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.min.js"></script>
    <script src="js/jquery-3.7.1.min.js"></script>
</head>

<body>
    <div id="app">
        {{ message }}

        <input v-model="message">
        <p v-if="seen">Now you see me</p>
        <ul>
            <li v-for="todo in lists">
                {{ todo }}
            </li>
        </ul>
        <ul>
            <li v-for="todo in lists_txt">
                {{ todo.text }}
            </li>
        </ul>

        <button v-on:click="showMessage">显示/隐藏</button>
    </div>
    <div id="app-jq">
        {{ message }}
    </div>
    <script>
        new Vue({
            el: '#app',//dom容器的id，必须和上面的标签的id保持一致
            data: {
                seen: false,//当修改seen参数为false的时候，<p>这个标签就不显示了
                message: 'Hello Vue!',//将Hello Vue!绑定到message
                lists: [1, 2, 3],
                lists_txt: [{ text: 'Learn JavaScript' },
                { text: 'Learn Vue' },
                { text: 'Build something awesome' }]
            },
            methods: {
                showMessage: function () {
                    this.seen = !this.seen;
                }
            }
        });
        $("#app-jq").text("hello vue!!!!")
    </script>
</body>

</html>